<?php
namespace app\validate;

use share\validate\SceneValidate;

class SendNoticeTableValidate extends SceneValidate{

    protected $rule = [
        'id' =>  'require',
        'model' => 'require|integer|>=:1|max:2',
        'level' => 'require|integer|>=:1|max:5',
        'beginTime' => 'require|integer',
        'endTime'=> 'require|integer',
        'language'=> 'require|length:2',
        'title'=> 'require|length:1,200',
        'message'=> 'require|length:1,2000',
        'status'=> 'require|integer|>=:0|max:1',
        'expire'=> 'require|integer',
    ];  
    
    protected $sceneRules = [   
        'edit' => [
            'id' =>  'require',
            'model' => 'integer|>=:1|max:2',
            'level' => 'integer|>=:1|max:5',
            'beginTime' => 'integer',
            'endTime'=> 'integer',
            'language'=> 'length:2',
            'title'=> 'length:1,200',
            'message'=> 'length:1,2000',
            'status'=> 'integer|>=:0|max:1',
            'expire'=> 'integer',
        ]
    ];

    protected $scene = [
        'add' => ['model','level','beginTime','endTime','language','title','message','status','expire'],  
        'edit' => ['id','model','level','beginTime','endTime','language','title','message','status','expire'],      
        'del' => ['id'],
    ];
}